#!/bin/bash

# 1: running
# 0: stopped

running_or_not() {
    if [ "$1" == "ha" ];then
        python /opt/fonsview/NE/csv/bin/ha_status.py
    else
        count=`ps -ef |grep "csvagent" |grep -v "grep" |wc -l`
        if [ $count -ne "0" ]; then
            echo "1"; exit 0
        else
            echo "0"; exit 0
        fi
    fi
}

if [ -d "${CSV_PATH}" ]; then
    running_or_not
fi

